<?php
$postData = file_get_contents("php://input");
// 将 JSON 数据解析为关联数组
$data = json_decode($postData, true);
$username = $data['username'];
$password = $data['password'];
$result = ['status' => 1,'message' => '登录成功','token' => ''];
if(empty($username) || empty($password)){
    $result['status'] = 0;
    $result['message'] = '输入信息为空';
    die(json_encode($result,true));
}
if($username != '测试'){
    $result['status'] = 0;
    $result['message'] = '用户名不正确';
    die(json_encode($result,true));
}
if($password != 'test'){
    $result['status'] = 0;
    $result['message'] = '密码不正确';
    die(json_encode($result,true));
}
$result['token'] = md5($username.$password);
die(json_encode($result,true));